package com.itxiaox.xview.demo.java.picker

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import android.widget.Toast
import com.github.itxiaox.picker.datapicker.DataPicker
import com.itxiaox.android.xutils.ui.UIHelper
import com.itxiaox.xview.demo.R

class PickerActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_picker)
    }

    fun dataPicker(view: View) {
        val datas: MutableList<String> = arrayListOf("9600","115200","13343s")
        DataPicker.getInstance().selectDataDialog(this, datas) { dialog, position ->

            UIHelper.toast("您选择的是：${datas[position]}")
            dialog.dismiss()
        }

    }
}